const path = require('path');

function resolve(dir) {
  return path.join(__dirname, dir);
}
const name = '礼物券H5';
module.exports = {
  publicPath:
    process.env.VUE_APP_ENV === 'production'
      ? '/'
      : '/',
  outputDir: 'dist',
  assetsDir: 'static',
  lintOnSave: process.env.NODE_ENV === 'development',
  productionSourceMap: false,
  devServer: {
    host: '0.0.0.0',
    port: 80,
    open: false,
    proxy: {
      [process.env.VUE_APP_BASE_API]: {
        // target: 'http://139.224.3.65/',
        // target: 'http://www.xn--0tr00ipxe696cnej.com/',
        target: 'http://8.155.172.0/',
        changeOrigin: true,
        pathRewrite: {
          [`^${process.env.VUE_APP_BASE_API}`]: '',
        },
      },
    },
    disableHostCheck: true,
  },
  configureWebpack: {
    name,
    resolve: {
      alias: {
        '@': resolve('src'),
      },
    },
  },
};
